package day04;
//累加和
public class Addition {
    public static void main(String[] args) {
        //累加和：1+2+3+4+....+100=5050
  /*
        int sum =0;
        for (int i=1;i<=100;i++){
            sum +=i;//sum =sum+i;
        }
        System.out.print(sum);

   */

        /*
        执行过程：
               sum=0
        i=1  t   sum=1
        i=2  t   sum=1+2
        i=3  t   sum=1+2+3
        ...      sum=1+2+3.....
        i=99 t   sum=1+..+99;
        i=100 t  sum=1+..+100
        i=102 f  结束
        */


//自创：累加前100的奇数和2500
/*
      int sum = 0;
      for (int i=1;i<=99;i+=2){
          sum +=i;
      }
        System.out.println(sum);

 */

//自创：前1000的偶数和250500
/*
       int sum =0;
       for (int i=2;i<=1000;i+=2){
           sum +=i;
       }
        System.out.println(sum);

 */

//

        for (int i=1,j=6;i<=6||j<=6;i+=2,j-=2){
            System.out.println(i+","+j);
        }

    }
}
